package com.longteng.lession.http.client;


import jodd.http.HttpRequest;
import jodd.http.HttpResponse;

/**
 * Created by celes on 2015/12/12
 */
public class HelloClient {


    public static void main(String[] args) {
        HttpRequest request = HttpRequest.get("http://localhost:8089/api/name").query("name","tianqing.wang");
        HttpResponse response = request.charset("UTF-8").send();
        if (response.statusCode() != 200){
            System.out.println("请求失败");
        }else{
            System.out.println(response.bodyText());
        }
        response.close();
    }
}
